package org.ymjava.medical.admin.web;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ymjava.medical.admin.annotation.LoginAdmin;
import org.ymjava.medical.core.util.ResponseUtil;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/admin/dashboard")
public class AdminDashbordController {
    private final Log logger = LogFactory.getLog(AdminDashbordController.class);

    @GetMapping("")
    public Object info(@LoginAdmin Integer adminId){
        if(adminId == null){
            return ResponseUtil.unlogin();
        }

        Map<String, Integer> data = new HashMap<>();
        data.put("userTotal", 0);
        data.put("goodsTotal", 0);
        data.put("productTotal", 0);
        data.put("orderTotal", 0);

        return ResponseUtil.ok(data);
    }

}
